home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLUT / lib / glut / strokegen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-11  |  33.3 KB  |  1,369 lines

  1.  
  2. # line 2 "strokegen.y"
  3. /* $XConsortium: to_wfont.y,v 5.7 94/04/17 20:10:08 rws Exp $ */
  4.  
  5. /*****************************************************************
  6.  
  7. Copyright (c) 1989,1990, 1991  X Consortium
  8.  
  9. Permission is hereby granted, free of charge, to any person obtaining a copy
  10. of this software and associated documentation files (the "Software"), to deal
  11. in the Software without restriction, including without limitation the rights
  12. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. copies of the Software, and to permit persons to whom the Software is
  14. furnished to do so, subject to the following conditions:
  15.  
  16. The above copyright notice and this permission notice shall be included in
  17. all copies or substantial portions of the Software.
  18.  
  19. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  22. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  23. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  24. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  25.  
  26. Except as contained in this notice, the name of the X Consortium shall not be
  27. used in advertising or otherwise to promote the sale, use or other dealings
  28. in this Software without prior written authorization from the X Consortium.
  29.  
  30. Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc.
  31.  
  32.                         All Rights Reserved
  33.  
  34. Permission to use, copy, modify, and distribute this software and its 
  35. documentation for any purpose and without fee is hereby granted, 
  36. provided that the above copyright notice appear in all copies and that
  37. both that copyright notice and this permission notice appear in 
  38. supporting documentation, and that the names of Sun Microsystems,
  39. and the X Consortium, not be used in advertising or publicity 
  40. pertaining to distribution of the software without specific, written 
  41. prior permission.  
  42.  
  43. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
  44. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  45. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  46. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  47. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  48. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  49. SOFTWARE.
  50.  
  51. ******************************************************************/
  52.  
  53.  
  54. #define YYMAXDEPTH 10000
  55.  
  56. #include <X11/Xos.h>
  57. #include <stdio.h>
  58. #include <ctype.h>
  59. #ifndef L_SET
  60. #define L_SET SEEK_SET
  61. #endif
  62. #include "stroke.h"
  63.  
  64. #ifdef X_NOT_STDC_ENV
  65. FILE *fopen();
  66. #endif
  67.  
  68. typedef struct {
  69.  
  70.         float           std_left,      /* NCGA standard left spacing */
  71.                         std_wide,      /* character width            */  
  72.                         std_rght;      /* Right spacing              */  
  73. }               Standard;
  74.  
  75.  
  76. char            fname[80];
  77. char            symname[80] = "FONT";
  78. Dispatch        *Table;    /* dispatch table */
  79. Standard    *sp_table; /* NCGA font spacings */
  80. Path            *strokes;  /* strokes of each character */
  81. Property        *property; /* property list */
  82.  
  83. struct {
  84.     int path, point, props;
  85. } count, expect;
  86.  
  87. Path_subpath   *current_path;
  88.  
  89. Font_header     head;        /* font header */
  90. int             tableindex;    /* which character */
  91. int             yyerrno;    /* error number */
  92.  
  93.  
  94. # line 94 "strokegen.y"
  95. typedef union
  96. #ifdef __cplusplus
  97.     YYSTYPE
  98. #endif
  99.  {
  100.     int    nil;    /* void is reserved */
  101.     int    ival;
  102.     float    dval;
  103.     char    *cval;
  104. } YYSTYPE;
  105. # define REAL 257
  106. # define INTEGER 258
  107. # define STRING 259
  108. # define BOTTOM 260
  109. # define CENTER 261
  110. # define CLOSE 262
  111. # define FONTNAME 263
  112. # define PROPERTIES 264
  113. # define NUM_CH 265
  114. # define INDEX 266
  115. # define L_SPACE 267
  116. # define MAGIC 268
  117. # define OPEN 269
  118. # define RIGHT 270
  119. # define R_SPACE 271
  120. # define STROKE 272
  121. # define TOP 273
  122. # define VERTICES 274
  123. # define BEARING 275
  124. # define WIDTH 276
  125.  
  126. #include <malloc.h>
  127. #include <memory.h>
  128. #include <unistd.h>
  129. #include <values.h>
  130.  
  131. #ifdef __cplusplus
  132.  
  133. #ifndef yyerror
  134.     void yyerror(const char *);
  135. #endif
  136. #ifndef yylex
  137.     extern "C" int yylex(void);
  138. #endif
  139.     int yyparse(void);
  140.  
  141. #endif
  142. #define yyclearin yychar = -1
  143. #define yyerrok yyerrflag = 0
  144. extern int yychar;
  145. extern int yyerrflag;
  146. YYSTYPE yylval;
  147. YYSTYPE yyval;
  148. typedef int yytabelem;
  149. #ifndef YYMAXDEPTH
  150. #define YYMAXDEPTH 150
  151. #endif
  152. #if YYMAXDEPTH > 0
  153. int yy_yys[YYMAXDEPTH], *yys = yy_yys;
  154. YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
  155. #else    /* user does initial allocation */
  156. int *yys;
  157. YYSTYPE *yyv;
  158. #endif
  159. static int yymaxdepth = YYMAXDEPTH;
  160. # define YYERRCODE 256
  161.  
  162. # line 207 "strokegen.y"
  163.  
  164.  
  165. #define BYE(err)    yyerrno = (err), yyerror()
  166.  
  167. #define ERR_BASE    1000
  168. #define OPEN_ERROR     1001
  169. #define WRITE_ERROR     1002
  170. #define WRONG_NAME     1003
  171. #define NO_MEMORY     1004
  172. #define EXCEED_PATH     1005
  173. #define EXCEED_POINT     1006
  174. #define PATH_MISMATCH    1007
  175. #define POINT_MISMATCH    1008
  176. #define PROP_MISMATCH   1009
  177. #define EXCEED_PROPS     1010
  178.  
  179. char    *prog;
  180.  
  181. main(argc, argv)
  182.     int             argc;
  183.     char           *argv[];
  184.  
  185. {
  186.     /* Usage : to_wfont [-o outfile] [infile] */
  187.     char           *s;
  188.  
  189.     fname[0] = 0;
  190.     tableindex = 0;
  191.     head.num_ch = -1;
  192.  
  193.     prog = *argv;
  194.     while (--argc > 0 && *++argv != NULL) {
  195.         s = *argv;
  196.         if (*s++ == '-')
  197.             switch (*s) {
  198.             case 's':
  199.                 if (*++argv != NULL)
  200.                 {
  201.                     --argc;
  202.                     (void) strcpy(symname, *argv);
  203.                 }
  204.                 break;
  205.             case 'o':
  206.                 if (*++argv != NULL)
  207.                 {
  208.                     --argc;
  209.                     (void) strcpy(fname, *argv);
  210.                 }
  211.                 break;
  212.             default:      /* ignore other options */
  213.                 ;
  214.             }
  215.         else {
  216.             FILE           *fp;
  217.  
  218.             /* standard input redirection */
  219.             fp = fopen(*argv, "r");
  220.             if (fp != NULL) {
  221.                 if (close(fileno(stdin)) < 0)
  222.                 {
  223.                     perror(prog);
  224.                     return;
  225.                 }
  226.                 if (dup(fileno(fp)) < 0)
  227.                 {
  228.                     perror(prog);
  229.                     return;
  230.                 }
  231.                 (void) fclose(fp);
  232.             }
  233.         }
  234.     }
  235.     return (yyparse());
  236. }
  237.  
  238. /* set number of characters */
  239. set_num_ch(num_ch)
  240. int num_ch;
  241. {
  242.     yyerrno = 0;
  243.     head.num_ch = num_ch;
  244.     if (num_ch > 0) {
  245.       Table    = (Dispatch *) malloc(num_ch * sizeof(Dispatch));
  246.       sp_table = (Standard *) malloc(num_ch * sizeof(Standard));
  247.       strokes  = (Path *)     malloc(num_ch * sizeof(Path));
  248.     }
  249.  
  250.     for (tableindex = 0; tableindex < num_ch; tableindex++) {
  251.         Table[tableindex].center = 0.0;
  252.         Table[tableindex].right = 0.0;
  253.         Table[tableindex].offset = 0;
  254.  
  255.         sp_table[tableindex].std_left = 0.0;
  256.         sp_table[tableindex].std_wide = 0.0;
  257.         sp_table[tableindex].std_rght = 0.0;
  258.  
  259.         strokes[tableindex].n_subpaths = 0;
  260.         strokes[tableindex].n_vertices = 0;
  261.         strokes[tableindex].subpaths = NULL;
  262.     }
  263. }
  264.  
  265. /* initialize the property info in the header */
  266. init_properties(num_props)
  267.     int             num_props;
  268. {
  269.     if (num_props > 0) {
  270.       head.properties = (Property *) 
  271.                           malloc (num_props * sizeof (Property));
  272.       head.num_props = expect.props = num_props;
  273.     }
  274.     else {
  275.       head.properties = NULL;
  276.       head.num_props = expect.props = 0;
  277.     }
  278.     count.props = -1;
  279.     property = head.properties;  /* initialize the list pointer */
  280. }
  281.  
  282. check_num_props()
  283. {
  284.         count.props++;
  285.         if (count.props != expect.props)
  286.       BYE (PROP_MISMATCH);
  287. }
  288.  
  289. /* add individual property info into the buffer */
  290. add_property(name, value)
  291.     char            *name,
  292.             *value;
  293. {
  294.         /* check if the property exceeds allocated space */
  295.  
  296.         if (++count.props >= head.num_props)
  297.          BYE(EXCEED_PROPS);
  298.  
  299.     /* copy the strings into the buffer */
  300.  
  301.     (void) strcpy (property->propname, name);
  302.     (void) strcpy (property->propvalue, value);
  303.  
  304.     /* increment the property pointer */
  305.  
  306.     property++;
  307. }
  308.  
  309. check_num_ch()
  310. {
  311.  
  312.   if (head.num_ch == -1)
  313.     set_num_ch(128);
  314.  
  315. }
  316.  
  317. yyerror()
  318. {
  319. #ifndef __bsdi__
  320.     extern int      yylineno;
  321. #endif
  322. #    define ERR_SIZE (sizeof(err_string) / sizeof(char *))
  323.     static char    *err_string[] = {
  324.         "Cannot open file",
  325.         "Write fails",
  326.         "Illegal font name",
  327.         "Memory allocation failure",
  328.         "Specified number of strokes exceeded",
  329.         "Specified number of points exceeded",
  330.         "Number of strokes do not match",
  331.         "Number of points do not match",
  332.         "Number of properties do not match",
  333.         "Specified number of properties exceeded",
  334.     0};
  335.     char           *str;
  336.  
  337.     yyerrno -= ERR_BASE;
  338.     if (yyerrno > 0 && yyerrno < ERR_SIZE)
  339.         str = err_string[yyerrno-1];
  340.     else
  341.         str = "Syntax error";
  342. #ifdef __bsdi__
  343.         fprintf(stderr, "%s.\n", str);
  344. #else
  345.         fprintf(stderr, "line %d: %s.\n", yylineno, str);
  346. #endif
  347.     freeall();
  348.     (void) unlink(fname);
  349.     exit(1);
  350. }
  351.  
  352. /* create wfont header */
  353. wf_header(name, top, bottom)
  354.     char           *name;
  355.     float           top,
  356.                     bottom;
  357. {
  358.  
  359.     if (name == NULL)
  360.         BYE(WRONG_NAME);
  361.     head.top = (float) top;
  362.     head.bottom = (float) bottom;
  363.     head.magic = WFONT_MAGIC_PEX;
  364.     (void) strcpy(head.name, name);
  365.     free(name);
  366. }
  367.  
  368. /* create header for each glyph */
  369. glyph_header(npath, center, right, npts)
  370.     int             npath,
  371.                     npts;
  372.     float           center,
  373.                     right;
  374. {
  375.      {
  376.     register Path  *strk = strokes + tableindex;
  377.     
  378.         if (npath > 0)     /* Don't allocate space unless the character
  379.                   has strokes associated with it. */
  380.     {
  381.         strk->subpaths = (Path_subpath *)
  382.             malloc(npath * sizeof (Path_subpath));
  383.  
  384.         if (strk->subpaths == NULL)
  385.             BYE(NO_MEMORY);
  386.  
  387.         strk->type = PATH_2DF;
  388.         strk->n_subpaths = npath;
  389.         strk->n_vertices = npts;
  390.     }
  391.     else {            /* Just initialize the entry */
  392.             strk->subpaths = NULL;
  393.         strk->type = PATH_2DF;
  394.         strk->n_subpaths = 0;
  395.         strk->n_vertices = 0;
  396.     }
  397.       }
  398.       {
  399.         register Dispatch *tbl = Table + tableindex;
  400.  
  401.         tbl->offset = 0;
  402.         tbl->center = center;
  403.         tbl->right = right;
  404.       }
  405.     count.path = -1;           /* initialize path counter, not to
  406.                         * exceed n_subpath */
  407. }
  408.  
  409. /* create standard spacing info for each glyph  */
  410. std_space(l_bear, wide, r_bear)
  411.  
  412.     float l_bear,
  413.           wide,
  414.           r_bear;
  415. {
  416.     register Standard *tbl = sp_table +tableindex;
  417.     tbl->std_left = l_bear;
  418.     tbl->std_wide = wide;
  419.     tbl->std_rght = r_bear;
  420. }
  421.  
  422. /* initialize each sub_path */
  423. init_path(close, n)
  424.     int             close,
  425.                     n;
  426. {
  427.     register Path_subpath *path;
  428.  
  429.     if (++count.path >= strokes[tableindex].n_subpaths)
  430.         BYE(EXCEED_PATH);
  431.     path = current_path = strokes[tableindex].subpaths + count.path;
  432.     path->n_pts = n;
  433.     path->closed = close;
  434.     if (n > 0) 
  435.       path->pts.pt2df = (Path_point2df *) 
  436.                          malloc(n * sizeof (Path_point2df));
  437.     if (path->pts.pt2df == NULL)
  438.         BYE(NO_MEMORY);
  439.     expect.point = path->n_pts;
  440.     count.point = -1;           /* initialize point counter, not to
  441.                         * exceed n_pts */
  442. }
  443.  
  444. /* accumulating points for each sub_path */
  445. add_point(x, y)
  446.     float           x,
  447.                     y;
  448. {
  449.     register Path_subpath   *path;
  450.     register Path_point2df    *pt_ptr;
  451.  
  452.     path = current_path;
  453.     if (++count.point >= path->n_pts)
  454.         BYE(EXCEED_POINT);
  455.     pt_ptr = path->pts.pt2df + count.point;
  456.     pt_ptr->x = x;
  457.     pt_ptr->y = y;
  458. }
  459.  
  460. /* Path_type + n_subpaths + n_vertices */
  461. #define STROKE_HEAD (sizeof (Path_type) + sizeof (int) + sizeof (int))
  462.  
  463. /* write out file, close everything, free everything */
  464. fini()
  465. {
  466.     static long     zero = 0;
  467.  
  468.     /* pointers used to walk the arrays */
  469.     register Path_subpath *spath;
  470.     register Dispatch *tbl_ptr;
  471.     register Path  *strptr;
  472.     register Property *prop_ptr;
  473.  
  474.     FILE           *fp;
  475.     int             npath;
  476.     register int    i,
  477.                     j,
  478.             k;
  479.     Standard    *sp_ptr;
  480.     Path_point2df    *pt;
  481.  
  482.         printf("\n/* GENERATED FILE -- DO NOT MODIFY */\n\n");
  483.         printf("#include \"glutstroke.h\"\n\n");
  484.  
  485. #    define BY_BYE(err) fclose(fp), BYE(err)
  486.  
  487.     /* adjust the characters for spacing, note max char width */
  488.     head.max_width = 0.0;
  489.     for (i = 0, tbl_ptr = Table, strptr = strokes, sp_ptr = sp_table;
  490.              i < head.num_ch; i++, tbl_ptr++, strptr++, sp_ptr++) {
  491.         tbl_ptr->center += sp_ptr->std_left;
  492.         tbl_ptr->right += sp_ptr->std_left + sp_ptr->std_rght;
  493.         if (tbl_ptr->right > head.max_width)
  494.             head.max_width = tbl_ptr->right;
  495.         npath = strptr->n_subpaths;
  496.         if (npath > 0 || tbl_ptr->center != 0.0 ||
  497.                     tbl_ptr->right != 0.0) {
  498.             for (j = 0, spath = strptr->subpaths;
  499.                              j < npath; j++, spath++) {
  500.                 for(k=0, pt = spath->pts.pt2df;
  501.                      k<spath->n_pts; k++, pt++) {
  502.                     pt->x += sp_ptr->std_left;
  503.                 }
  504.             }
  505.         }
  506.     }
  507.  
  508.     /* write the stroke table */
  509.     for (i = 0, tbl_ptr = Table, strptr = strokes;
  510.          i < head.num_ch; i++, tbl_ptr++, strptr++) {
  511.         if (strptr->n_subpaths > 0 &&
  512.             tbl_ptr->center != 0.0 &&
  513.             tbl_ptr->right != 0.0) {
  514.             if(isprint(i)) {
  515.                 printf("/* char: %d '%c' */\n\n", i, i);
  516.             } else {
  517.                 printf("/* char: %d */\n\n", i);
  518.             }
  519.  
  520.             for (j = 0, spath = strptr->subpaths;
  521.                  j < strptr->n_subpaths; j++, spath++) {
  522.                 int z;
  523.  
  524.                 printf("static CoordRec char%d_stroke%d[] = {\n", i, j);
  525.                 for(z = 0; z < spath->n_pts; z++) {
  526.                     printf("    { %g, %g },\n",
  527.                         spath->pts.pt2df[z].x, spath->pts.pt2df[z].y);
  528.                 }
  529.                 printf("};\n\n");
  530.             }
  531.  
  532.             printf("static StrokeRec char%d[] = {\n", i);
  533.                         for (j = 0, spath = strptr->subpaths;
  534.                              j < strptr->n_subpaths; j++, spath++) {
  535.                 printf("   { %d, char%d_stroke%d },\n",
  536.                     spath->n_pts, i, j);
  537.             }
  538.             printf("};\n\n");
  539.         }
  540.     }
  541.     printf("static StrokeCharRec chars[] = {\n");
  542.     for (i = 0, tbl_ptr = Table, strptr = strokes;
  543.          i < head.num_ch; i++, tbl_ptr++, strptr++) {
  544.         if (strptr->n_subpaths > 0 &&
  545.         tbl_ptr->center != 0.0 &&
  546.         tbl_ptr->right != 0.0) {
  547.         printf("    { %d, char%d, %g, %g },\n",
  548.             strptr->n_subpaths, i, tbl_ptr->center, tbl_ptr->right);
  549.         } else {
  550.         printf("    { 0, /* char%d */ 0, %g, %g },\n",
  551.             i, tbl_ptr->center, tbl_ptr->right);
  552.         }
  553.     }
  554.     printf("};\n\n");
  555.  
  556.     printf("StrokeFontRec %s = { \"%s\", %d, chars, %.6g, %.6g };\n\n",
  557.         symname, head.name, head.num_ch,
  558.         (double) head.top, (double) head.bottom);
  559.  
  560.     fflush(stdout);
  561.  
  562.     freeall();
  563. #    undef BY_BYE
  564. }
  565.  
  566. freeall()
  567. {
  568.     register Path  *path;
  569.     register Path_subpath *spath;
  570.     register int    i,
  571.                     j,
  572.                     n;
  573.  
  574.     path = strokes;
  575.     for (i = 0; i < head.num_ch; i++, path++) {
  576.         n = path->n_subpaths;
  577.         if (n <= 0)
  578.             continue;
  579.         spath = path->subpaths;
  580.         for (j = 0; j < n; j++, spath++)
  581.             if (spath->pts.pt2df != NULL)
  582.                 free((char *) spath->pts.pt2df);
  583.         if (path->subpaths != NULL)
  584.             free((char *) path->subpaths);
  585.     }
  586.     free(Table);
  587.     free(sp_table);
  588.     free(strokes);
  589.     if (head.properties != NULL)
  590.       free((char *) head.properties);
  591. }
  592.  
  593. check_nstroke()
  594. {
  595.     count.path++;
  596.     if (expect.path != count.path)
  597.         BYE(PATH_MISMATCH);
  598. }
  599.  
  600. check_npts()
  601. {
  602.     count.point++;
  603.     if (expect.point != count.point)
  604.         BYE(POINT_MISMATCH);
  605. }
  606. yytabelem yyexca[] ={
  607. -1, 1,
  608.     0, -1,
  609.     -2, 0,
  610.     };
  611. # define YYNPROD 45
  612. # define YYLAST 93
  613. yytabelem yyact[]={
  614.  
  615.     70,    42,    67,    13,    37,    74,    58,    23,    61,     7,
  616.     11,    17,    11,     4,    24,    46,    28,    63,    53,    14,
  617.     72,    50,    47,    34,    31,    26,    18,    76,    75,    71,
  618.     68,    65,    56,    59,    38,    29,    54,    51,    39,    20,
  619.      6,    49,    40,    55,    44,    21,    35,    25,     9,    19,
  620.      8,    52,    43,    15,     2,    73,    30,    69,    60,    41,
  621.     22,    32,     5,    10,    33,    66,    36,    57,    45,    27,
  622.     12,    16,     3,     1,     0,     0,     0,     0,     0,    48,
  623.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  624.     62,     0,    64 };
  625. yytabelem yypact[]={
  626.  
  627.   -250,-10000000,  -256,  -270,  -240,  -253,-10000000,  -232,  -254,  -255,
  628. -10000000,  -233,  -244,  -222,-10000000,  -254,-10000000,  -234,-10000000,-10000000,
  629. -10000000,  -255,  -235,-10000000,-10000000,  -268,-10000000,-10000000,  -223,-10000000,
  630.   -274,-10000000,-10000000,-10000000,-10000000,-10000000,  -246,  -236,-10000000,-10000000,
  631.   -274,-10000000,  -237,  -241,  -225,  -264,  -224,-10000000,-10000000,  -259,
  632. -10000000,-10000000,  -241,  -242,-10000000,  -225,  -226,  -272,  -227,-10000000,
  633.   -276,  -228,-10000000,-10000000,-10000000,-10000000,-10000000,  -238,-10000000,  -266,
  634.   -229,-10000000,-10000000,-10000000,  -230,-10000000,-10000000 };
  635. yytabelem yypgo[]={
  636.  
  637.      0,    73,    72,    71,    70,    69,    68,    67,    66,    65,
  638.     64,    63,    62,    60,    59,    58,    57,    55,    54,    53,
  639.     40,    38,    52,    37,    51,    50,    48,    39,    47,    46,
  640.     45,    44,    36,    43,    42,    41 };
  641. yytabelem yyr1[]={
  642.  
  643.      0,     1,     1,    18,     2,     4,     5,    12,    19,    19,
  644.     22,     3,    23,    23,    24,    20,    20,    25,    28,    26,
  645.     29,    11,     8,     9,     9,     6,     7,    27,    27,    31,
  646.     30,    32,    32,    13,    13,    10,    33,    21,    21,    35,
  647.     34,    14,    15,    16,    17 };
  648. yytabelem yyr2[]={
  649.  
  650.      0,    11,     5,     7,     5,     5,     5,     5,     0,     2,
  651.      1,     9,     0,     4,     5,     0,     4,     5,     1,     6,
  652.      9,     5,     5,     1,     5,     5,     5,     0,     4,     1,
  653.      9,     0,     4,     3,     3,     3,     5,     0,     4,     1,
  654.     11,     5,     5,     5,     5 };
  655. yytabelem yychk[]={
  656.  
  657. -10000000,    -1,   -18,    -2,   263,   -12,   -20,   265,   -25,   -26,
  658.    -11,   266,    -4,   273,   259,   -19,    -3,   264,   258,   -20,
  659.    -27,   -30,   -13,   262,   269,   -28,   258,    -5,   260,   257,
  660.    -20,   258,   -27,   -10,   258,   -29,    -8,   272,   257,   -21,
  661.    -34,   -14,   275,   -22,   -31,    -6,   261,   258,   -21,   -35,
  662.    258,   -23,   -24,   259,   -32,   -33,   257,    -7,   270,   257,
  663.    -15,   267,   -23,   259,   -32,   257,    -9,   274,   257,   -16,
  664.    276,   257,   258,   -17,   271,   257,   257 };
  665. yytabelem yydef[]={
  666.  
  667.      0,    -2,    15,     0,     0,     8,     2,     0,    15,    27,
  668.     18,     0,     0,     0,     4,    15,     9,     0,     7,    16,
  669.     17,    27,     0,    33,    34,     0,    21,     3,     0,     5,
  670.     37,    10,    28,    29,    35,    19,     0,     0,     6,     1,
  671.     37,    39,     0,    12,    31,     0,     0,    22,    38,     0,
  672.     41,    11,    12,     0,    30,    31,     0,    23,     0,    25,
  673.      0,     0,    13,    14,    32,    36,    20,     0,    26,     0,
  674.      0,    42,    24,    40,     0,    43,    44 };
  675. typedef struct
  676. #ifdef __cplusplus
  677.     yytoktype
  678. #endif
  679. { char *t_name; int t_val; } yytoktype;
  680. #ifndef YYDEBUG
  681. #    define YYDEBUG    0    /* don't allow debugging */
  682. #endif
  683.  
  684. #if YYDEBUG
  685.  
  686. yytoktype yytoks[] =
  687. {
  688.     "REAL",    257,
  689.     "INTEGER",    258,
  690.     "STRING",    259,
  691.     "BOTTOM",    260,
  692.     "CENTER",    261,
  693.     "CLOSE",    262,
  694.     "FONTNAME",    263,
  695.     "PROPERTIES",    264,
  696.     "NUM_CH",    265,
  697.     "INDEX",    266,
  698.     "L_SPACE",    267,
  699.     "MAGIC",    268,
  700.     "OPEN",    269,
  701.     "RIGHT",    270,
  702.     "R_SPACE",    271,
  703.     "STROKE",    272,
  704.     "TOP",    273,
  705.     "VERTICES",    274,
  706.     "BEARING",    275,
  707.     "WIDTH",    276,
  708.     "-unknown-",    -1    /* ends search */
  709. };
  710.  
  711. char * yyreds[] =
  712. {
  713.     "-no such reduction-",
  714.     "font : fontheader num_ch fontprops fontbody spacing",
  715.     "font : fontheader fontbody",
  716.     "fontheader : fontname top bottom",
  717.     "fontname : FONTNAME STRING",
  718.     "top : TOP REAL",
  719.     "bottom : BOTTOM REAL",
  720.     "num_ch : NUM_CH INTEGER",
  721.     "fontprops : /* empty */",
  722.     "fontprops : properties",
  723.     "properties : PROPERTIES INTEGER",
  724.     "properties : PROPERTIES INTEGER property_list",
  725.     "property_list : /* empty */",
  726.     "property_list : single_property property_list",
  727.     "single_property : STRING STRING",
  728.     "fontbody : /* empty */",
  729.     "fontbody : glyph fontbody",
  730.     "glyph : glyph_header strokes",
  731.     "glyph_header : index",
  732.     "glyph_header : index sym_headinfo",
  733.     "sym_headinfo : nstroke center right nvertice",
  734.     "index : INDEX INTEGER",
  735.     "nstroke : STROKE INTEGER",
  736.     "nvertice : /* empty */",
  737.     "nvertice : VERTICES INTEGER",
  738.     "center : CENTER REAL",
  739.     "right : RIGHT REAL",
  740.     "strokes : /* empty */",
  741.     "strokes : path strokes",
  742.     "path : closeflag n_pts",
  743.     "path : closeflag n_pts points",
  744.     "points : /* empty */",
  745.     "points : coord points",
  746.     "closeflag : CLOSE",
  747.     "closeflag : OPEN",
  748.     "n_pts : INTEGER",
  749.     "coord : REAL REAL",
  750.     "spacing : /* empty */",
  751.     "spacing : item spacing",
  752.     "item : counter",
  753.     "item : counter sp_left wide sp_right",
  754.     "counter : BEARING INTEGER",
  755.     "sp_left : L_SPACE REAL",
  756.     "wide : WIDTH REAL",
  757.     "sp_right : R_SPACE REAL",
  758. };
  759. #endif /* YYDEBUG */
  760. /* 
  761.  *    Copyright 1987 Silicon Graphics, Inc. - All Rights Reserved
  762.  */
  763.  
  764. /* #ident    "@(#)yacc:yaccpar    1.10" */
  765. #ident    "$Revision: 1.10 $"
  766.  
  767. /*
  768. ** Skeleton parser driver for yacc output
  769. */
  770. #include "stddef.h"
  771.  
  772. /*
  773. ** yacc user known macros and defines
  774. */
  775. #define YYERROR        goto yyerrlab
  776. #define YYACCEPT    return(0)
  777. #define YYABORT        return(1)
  778. #ifdef __cplusplus
  779. #define YYBACKUP( newtoken, newvalue )\
  780. {\
  781.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  782.     {\
  783.         yyerror( gettxt("uxlibc:78", "syntax error - cannot backup") );\
  784.         goto yyerrlab;\
  785.     }\
  786.     yychar = newtoken;\
  787.     yystate = *yyps;\
  788.     yylval = newvalue;\
  789.     goto yynewstate;\
  790. }
  791. #else
  792. #define YYBACKUP( newtoken, newvalue )\
  793. {\
  794.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  795.     {\
  796.         yyerror( gettxt("uxlibc:78", "Syntax error - cannot backup") );\
  797.         goto yyerrlab;\
  798.     }\
  799.     yychar = newtoken;\
  800.     yystate = *yyps;\
  801.     yylval = newvalue;\
  802.     goto yynewstate;\
  803. }
  804. #endif
  805. #define YYRECOVERING()    (!!yyerrflag)
  806. #define YYNEW(type)    malloc(sizeof(type) * yynewmax)
  807. #define YYCOPY(to, from, type) \
  808.     (type *) memcpy(to, (char *) from, yynewmax * sizeof(type))
  809. #define YYENLARGE( from, type) \
  810.     (type *) realloc((char *) from, yynewmax * sizeof(type))
  811. #ifndef YYDEBUG
  812. #    define YYDEBUG    1    /* make debugging available */
  813. #endif
  814.  
  815. /*
  816. ** user known globals
  817. */
  818. int yydebug;            /* set to 1 to get debugging */
  819.  
  820. /*
  821. ** driver internal defines
  822. */
  823. #define YYFLAG        (-10000000)
  824.  
  825. /*
  826. ** global variables used by the parser
  827. */
  828. YYSTYPE *yypv;            /* top of value stack */
  829. int *yyps;            /* top of state stack */
  830.  
  831. int yystate;            /* current state */
  832. int yytmp;            /* extra var (lasts between blocks) */
  833.  
  834. int yynerrs;            /* number of errors */
  835. int yyerrflag;            /* error recovery flag */
  836. int yychar;            /* current input token number */
  837.  
  838.  
  839.  
  840. /*
  841. ** yyparse - return 0 if worked, 1 if syntax error not recovered from
  842. */
  843. #if defined(__STDC__) || defined(__cplusplus)
  844. int yyparse(void)
  845. #else
  846. int yyparse()
  847. #endif
  848. {
  849.     register YYSTYPE *yypvt;    /* top of value stack for $vars */
  850.  
  851.     /*
  852.     ** Initialize externals - yyparse may be called more than once
  853.     */
  854.     yypv = &yyv[-1];
  855.     yyps = &yys[-1];
  856.     yystate = 0;
  857.     yytmp = 0;
  858.     yynerrs = 0;
  859.     yyerrflag = 0;
  860.     yychar = -1;
  861.  
  862. #if YYMAXDEPTH <= 0
  863.     if (yymaxdepth <= 0)
  864.     {
  865.         if ((yymaxdepth = YYEXPAND(0)) <= 0)
  866.         {
  867. #ifdef __cplusplus
  868.             yyerror(gettxt("uxlibc:79", "yacc initialization error"));
  869. #else
  870.             yyerror(gettxt("uxlibc:79", "Yacc initialization error"));
  871. #endif
  872.             YYABORT;
  873.         }
  874.     }
  875. #endif
  876.  
  877.     goto yystack;
  878.     {
  879.         register YYSTYPE *yy_pv;    /* top of value stack */
  880.         register int *yy_ps;        /* top of state stack */
  881.         register int yy_state;        /* current state */
  882.         register int  yy_n;        /* internal state number info */
  883.  
  884.         /*
  885.         ** get globals into registers.
  886.         ** branch to here only if YYBACKUP was called.
  887.         */
  888.     yynewstate:
  889.         yy_pv = yypv;
  890.         yy_ps = yyps;
  891.         yy_state = yystate;
  892.         goto yy_newstate;
  893.  
  894.         /*
  895.         ** get globals into registers.
  896.         ** either we just started, or we just finished a reduction
  897.         */
  898.     yystack:
  899.         yy_pv = yypv;
  900.         yy_ps = yyps;
  901.         yy_state = yystate;
  902.  
  903.         /*
  904.         ** top of for (;;) loop while no reductions done
  905.         */
  906.     yy_stack:
  907.         /*
  908.         ** put a state and value onto the stacks
  909.         */
  910. #if YYDEBUG
  911.         /*
  912.         ** if debugging, look up token value in list of value vs.
  913.         ** name pairs.  0 and negative (-1) are special values.
  914.         ** Note: linear search is used since time is not a real
  915.         ** consideration while debugging.
  916.         */
  917.         if ( yydebug )
  918.         {
  919.             register int yy_i;
  920.  
  921.             printf( "State %d, token ", yy_state );
  922.             if ( yychar == 0 )
  923.                 printf( "end-of-file\n" );
  924.             else if ( yychar < 0 )
  925.                 printf( "-none-\n" );
  926.             else
  927.             {
  928.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  929.                     yy_i++ )
  930.                 {
  931.                     if ( yytoks[yy_i].t_val == yychar )
  932.                         break;
  933.                 }
  934.                 printf( "%s\n", yytoks[yy_i].t_name );
  935.             }
  936.         }
  937. #endif /* YYDEBUG */
  938.         if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
  939.         {
  940.             int yynewmax;
  941.             ptrdiff_t yys_off;
  942.  
  943.             /* The following pointer-differences are safe, since
  944.              * yypvt, yy_pv, and yypv all are a multiple of
  945.              * sizeof(YYSTYPE) bytes from yyv.
  946.              */
  947.             ptrdiff_t yypvt_off = yypvt - yyv;
  948.             ptrdiff_t yy_pv_off = yy_pv - yyv;
  949.             ptrdiff_t yypv_off = yypv - yyv;
  950.  
  951.             int *yys_base = yys;
  952. #ifdef YYEXPAND
  953.             yynewmax = YYEXPAND(yymaxdepth);
  954. #else
  955.             yynewmax = 2 * yymaxdepth;    /* double table size */
  956.             if (yymaxdepth == YYMAXDEPTH)    /* first time growth */
  957.             {
  958.                 void *newyys = YYNEW(int);
  959.                 void *newyyv = YYNEW(YYSTYPE);
  960.                 if (newyys != 0 && newyyv != 0)
  961.                 {
  962.                     yys = YYCOPY(newyys, yys, int);
  963.                     yyv = YYCOPY(newyyv, yyv, YYSTYPE);
  964.                 }
  965.                 else
  966.                     yynewmax = 0;    /* failed */
  967.             }
  968.             else                /* not first time */
  969.             {
  970.                 yys = YYENLARGE(yys, int);
  971.                 yyv = YYENLARGE(yyv, YYSTYPE);
  972.                 if (yys == 0 || yyv == 0)
  973.                     yynewmax = 0;    /* failed */
  974.             }
  975. #endif
  976.             if (yynewmax <= yymaxdepth)    /* tables not expanded */
  977.             {
  978. #ifdef __cplusplus
  979.                 yyerror( gettxt("uxlibc:80", "yacc stack overflow") );
  980. #else
  981.                 yyerror( gettxt("uxlibc:80", "Yacc stack overflow") );
  982. #endif
  983.                 YYABORT;
  984.             }
  985.             yymaxdepth = yynewmax;
  986.  
  987.             /* reset pointers into yys */
  988.             yys_off = yys - yys_base;
  989.             yy_ps = yy_ps + yys_off;
  990.             yyps = yyps + yys_off;
  991.  
  992.             /* reset pointers into yyv */
  993.             yypvt = yyv + yypvt_off;
  994.             yy_pv = yyv + yy_pv_off;
  995.             yypv = yyv + yypv_off;
  996.         }
  997.         *yy_ps = yy_state;
  998.         *++yy_pv = yyval;
  999.  
  1000.         /*
  1001.         ** we have a new state - find out what to do
  1002.         */
  1003.     yy_newstate:
  1004.         if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
  1005.             goto yydefault;        /* simple state */
  1006. #if YYDEBUG
  1007.         /*
  1008.         ** if debugging, need to mark whether new token grabbed
  1009.         */
  1010.         yytmp = yychar < 0;
  1011. #endif
  1012.         if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1013.             yychar = 0;        /* reached EOF */
  1014. #if YYDEBUG
  1015.         if ( yydebug && yytmp )
  1016.         {
  1017.             register int yy_i;
  1018.  
  1019.             printf( "Received token " );
  1020.             if ( yychar == 0 )
  1021.                 printf( "end-of-file\n" );
  1022.             else if ( yychar < 0 )
  1023.                 printf( "-none-\n" );
  1024.             else
  1025.             {
  1026.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1027.                     yy_i++ )
  1028.                 {
  1029.                     if ( yytoks[yy_i].t_val == yychar )
  1030.                         break;
  1031.                 }
  1032.                 printf( "%s\n", yytoks[yy_i].t_name );
  1033.             }
  1034.         }
  1035. #endif /* YYDEBUG */
  1036.         if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
  1037.             goto yydefault;
  1038.         if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )    /*valid shift*/
  1039.         {
  1040.             yychar = -1;
  1041.             yyval = yylval;
  1042.             yy_state = yy_n;
  1043.             if ( yyerrflag > 0 )
  1044.                 yyerrflag--;
  1045.             goto yy_stack;
  1046.         }
  1047.  
  1048.     yydefault:
  1049.         if ( ( yy_n = yydef[ yy_state ] ) == -2 )
  1050.         {
  1051. #if YYDEBUG
  1052.             yytmp = yychar < 0;
  1053. #endif
  1054.             if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1055.                 yychar = 0;        /* reached EOF */
  1056. #if YYDEBUG
  1057.             if ( yydebug && yytmp )
  1058.             {
  1059.                 register int yy_i;
  1060.  
  1061.                 printf( "Received token " );
  1062.                 if ( yychar == 0 )
  1063.                     printf( "end-of-file\n" );
  1064.                 else if ( yychar < 0 )
  1065.                     printf( "-none-\n" );
  1066.                 else
  1067.                 {
  1068.                     for ( yy_i = 0;
  1069.                         yytoks[yy_i].t_val >= 0;
  1070.                         yy_i++ )
  1071.                     {
  1072.                         if ( yytoks[yy_i].t_val
  1073.                             == yychar )
  1074.                         {
  1075.                             break;
  1076.                         }
  1077.                     }
  1078.                     printf( "%s\n", yytoks[yy_i].t_name );
  1079.                 }
  1080.             }
  1081. #endif /* YYDEBUG */
  1082.             /*
  1083.             ** look through exception table
  1084.             */
  1085.             {
  1086.                 register int *yyxi = yyexca;
  1087.  
  1088.                 while ( ( *yyxi != -1 ) ||
  1089.                     ( yyxi[1] != yy_state ) )
  1090.                 {
  1091.                     yyxi += 2;
  1092.                 }
  1093.                 while ( ( *(yyxi += 2) >= 0 ) &&
  1094.                     ( *yyxi != yychar ) )
  1095.                     ;
  1096.                 if ( ( yy_n = yyxi[1] ) < 0 )
  1097.                     YYACCEPT;
  1098.             }
  1099.         }
  1100.  
  1101.         /*
  1102.         ** check for syntax error
  1103.         */
  1104.         if ( yy_n == 0 )    /* have an error */
  1105.         {
  1106.             /* no worry about speed here! */
  1107.             switch ( yyerrflag )
  1108.             {
  1109.             case 0:        /* new error */
  1110. #ifdef __cplusplus
  1111.                 yyerror( gettxt("uxlibc:81", "syntax error") );
  1112. #else
  1113.                 yyerror( gettxt("uxlibc:81", "Syntax error") );
  1114. #endif
  1115.                 goto skip_init;
  1116.             yyerrlab:
  1117.                 /*
  1118.                 ** get globals into registers.
  1119.                 ** we have a user generated syntax type error
  1120.                 */
  1121.                 yy_pv = yypv;
  1122.                 yy_ps = yyps;
  1123.                 yy_state = yystate;
  1124.                 yynerrs++;
  1125.                 /* FALLTHRU */
  1126.             skip_init:
  1127.             case 1:
  1128.             case 2:        /* incompletely recovered error */
  1129.                     /* try again... */
  1130.                 yyerrflag = 3;
  1131.                 /*
  1132.                 ** find state where "error" is a legal
  1133.                 ** shift action
  1134.                 */
  1135.                 while ( yy_ps >= yys )
  1136.                 {
  1137.                     yy_n = yypact[ *yy_ps ] + YYERRCODE;
  1138.                     if ( yy_n >= 0 && yy_n < YYLAST &&
  1139.                         yychk[yyact[yy_n]] == YYERRCODE)                    {
  1140.                         /*
  1141.                         ** simulate shift of "error"
  1142.                         */
  1143.                         yy_state = yyact[ yy_n ];
  1144.                         goto yy_stack;
  1145.                     }
  1146.                     /*
  1147.                     ** current state has no shift on
  1148.                     ** "error", pop stack
  1149.                     */
  1150. #if YYDEBUG
  1151. #    define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  1152.                     if ( yydebug )
  1153.                         printf( _POP_, *yy_ps,
  1154.                             yy_ps[-1] );
  1155. #    undef _POP_
  1156. #endif
  1157.                     yy_ps--;
  1158.                     yy_pv--;
  1159.                 }
  1160.                 /*
  1161.                 ** there is no state on stack with "error" as
  1162.                 ** a valid shift.  give up.
  1163.                 */
  1164.                 YYABORT;
  1165.             case 3:        /* no shift yet; eat a token */
  1166. #if YYDEBUG
  1167.                 /*
  1168.                 ** if debugging, look up token in list of
  1169.                 ** pairs.  0 and negative shouldn't occur,
  1170.                 ** but since timing doesn't matter when
  1171.                 ** debugging, it doesn't hurt to leave the
  1172.                 ** tests here.
  1173.                 */
  1174.                 if ( yydebug )
  1175.                 {
  1176.                     register int yy_i;
  1177.  
  1178.                     printf( "Error recovery discards " );
  1179.                     if ( yychar == 0 )
  1180.                         printf( "token end-of-file\n" );
  1181.                     else if ( yychar < 0 )
  1182.                         printf( "token -none-\n" );
  1183.                     else
  1184.                     {
  1185.                         for ( yy_i = 0;
  1186.                             yytoks[yy_i].t_val >= 0;
  1187.                             yy_i++ )
  1188.                         {
  1189.                             if ( yytoks[yy_i].t_val
  1190.                                 == yychar )
  1191.                             {
  1192.                                 break;
  1193.                             }
  1194.                         }
  1195.                         printf( "token %s\n",
  1196.                             yytoks[yy_i].t_name );
  1197.                     }
  1198.                 }
  1199. #endif /* YYDEBUG */
  1200.                 if ( yychar == 0 )    /* reached EOF. quit */
  1201.                     YYABORT;
  1202.                 yychar = -1;
  1203.                 goto yy_newstate;
  1204.             }
  1205.         }/* end if ( yy_n == 0 ) */
  1206.         /*
  1207.         ** reduction by production yy_n
  1208.         ** put stack tops, etc. so things right after switch
  1209.         */
  1210. #if YYDEBUG
  1211.         /*
  1212.         ** if debugging, print the string that is the user's
  1213.         ** specification of the reduction which is just about
  1214.         ** to be done.
  1215.         */
  1216.         if ( yydebug )
  1217.             printf( "Reduce by (%d) \"%s\"\n",
  1218.                 yy_n, yyreds[ yy_n ] );
  1219. #endif
  1220.         yytmp = yy_n;            /* value to switch over */
  1221.         yypvt = yy_pv;            /* $vars top of value stack */
  1222.         /*
  1223.         ** Look in goto table for next state
  1224.         ** Sorry about using yy_state here as temporary
  1225.         ** register variable, but why not, if it works...
  1226.         ** If yyr2[ yy_n ] doesn't have the low order bit
  1227.         ** set, then there is no action to be done for
  1228.         ** this reduction.  So, no saving & unsaving of
  1229.         ** registers done.  The only difference between the
  1230.         ** code just after the if and the body of the if is
  1231.         ** the goto yy_stack in the body.  This way the test
  1232.         ** can be made before the choice of what to do is needed.
  1233.         */
  1234.         {
  1235.             /* length of production doubled with extra bit */
  1236.             register int yy_len = yyr2[ yy_n ];
  1237.  
  1238.             if ( !( yy_len & 01 ) )
  1239.             {
  1240.                 yy_len >>= 1;
  1241.                 yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  1242.                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1243.                     *( yy_ps -= yy_len ) + 1;
  1244.                 if ( yy_state >= YYLAST ||
  1245.                     yychk[ yy_state =
  1246.                     yyact[ yy_state ] ] != -yy_n )
  1247.                 {
  1248.                     yy_state = yyact[ yypgo[ yy_n ] ];
  1249.                 }
  1250.                 goto yy_stack;
  1251.             }
  1252.             yy_len >>= 1;
  1253.             yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  1254.             yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1255.                 *( yy_ps -= yy_len ) + 1;
  1256.             if ( yy_state >= YYLAST ||
  1257.                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
  1258.             {
  1259.                 yy_state = yyact[ yypgo[ yy_n ] ];
  1260.             }
  1261.         }
  1262.                     /* save until reenter driver code */
  1263.         yystate = yy_state;
  1264.         yyps = yy_ps;
  1265.         yypv = yy_pv;
  1266.     }
  1267.     /*
  1268.     ** code supplied by user is placed in this switch
  1269.     */
  1270.     switch( yytmp )
  1271.     {
  1272.         
  1273. case 1:
  1274. # line 135 "strokegen.y"
  1275. { fini(); } break;
  1276. case 2:
  1277. # line 136 "strokegen.y"
  1278. { fini(); } break;
  1279. case 3:
  1280. # line 139 "strokegen.y"
  1281. { wf_header(yypvt[-2].cval, yypvt[-1].dval, yypvt[-0].dval); } break;
  1282. case 4:
  1283. # line 142 "strokegen.y"
  1284. { yyval.cval = yypvt[-0].cval; } break;
  1285. case 5:
  1286. # line 144 "strokegen.y"
  1287. { yyval.dval = yypvt[-0].dval;} break;
  1288. case 6:
  1289. # line 146 "strokegen.y"
  1290. { yyval.dval = yypvt[-0].dval;} break;
  1291. case 7:
  1292. # line 148 "strokegen.y"
  1293. { set_num_ch(yypvt[-0].ival);} break;
  1294. case 10:
  1295. # line 152 "strokegen.y"
  1296. { init_properties (yypvt[-0].ival); } break;
  1297. case 11:
  1298. # line 153 "strokegen.y"
  1299. { check_num_props (); } break;
  1300. case 14:
  1301. # line 157 "strokegen.y"
  1302. { add_property(yypvt[-1].cval, yypvt[-0].cval); } break;
  1303. case 17:
  1304. # line 163 "strokegen.y"
  1305. { check_nstroke(); } break;
  1306. case 18:
  1307. # line 165 "strokegen.y"
  1308. { tableindex = yypvt[-0].ival; } break;
  1309. case 20:
  1310. # line 168 "strokegen.y"
  1311. { glyph_header(yypvt[-3].ival, yypvt[-2].dval, yypvt[-1].dval, yypvt[-0].ival); } break;
  1312. case 21:
  1313. # line 170 "strokegen.y"
  1314. { check_num_ch(); yyval.ival = yypvt[-0].ival; } break;
  1315. case 22:
  1316. # line 172 "strokegen.y"
  1317. { yyval.ival = yypvt[-0].ival; expect.path = yypvt[-0].ival; } break;
  1318. case 23:
  1319. # line 174 "strokegen.y"
  1320. {yyval.ival = 0;} break;
  1321. case 24:
  1322. # line 174 "strokegen.y"
  1323. { yyval.ival = yypvt[-0].ival; } break;
  1324. case 25:
  1325. # line 176 "strokegen.y"
  1326. { yyval.dval = yypvt[-0].dval; } break;
  1327. case 26:
  1328. # line 178 "strokegen.y"
  1329. { yyval.dval = yypvt[-0].dval; } break;
  1330. case 29:
  1331. # line 182 "strokegen.y"
  1332. { init_path(yypvt[-1].ival, yypvt[-0].ival); } break;
  1333. case 30:
  1334. # line 183 "strokegen.y"
  1335. { check_npts(); } break;
  1336. case 33:
  1337. # line 187 "strokegen.y"
  1338. { yyval.ival = yypvt[-0].nil == CLOSE; } break;
  1339. case 34:
  1340. # line 187 "strokegen.y"
  1341. { yyval.ival = yypvt[-0].nil == CLOSE; } break;
  1342. case 35:
  1343. # line 189 "strokegen.y"
  1344. { yyval.ival = yypvt[-0].ival; } break;
  1345. case 36:
  1346. # line 191 "strokegen.y"
  1347. { add_point(yypvt[-1].dval, yypvt[-0].dval); } break;
  1348. case 39:
  1349. # line 196 "strokegen.y"
  1350. {tableindex = yypvt[-0].ival;} break;
  1351. case 40:
  1352. # line 197 "strokegen.y"
  1353. { std_space(yypvt[-2].dval, yypvt[-1].dval, yypvt[-0].dval); } break;
  1354. case 41:
  1355. # line 199 "strokegen.y"
  1356. {yyval.ival = yypvt[-0].ival;} break;
  1357. case 42:
  1358. # line 201 "strokegen.y"
  1359. {yyval.dval = yypvt[-0].dval;} break;
  1360. case 43:
  1361. # line 203 "strokegen.y"
  1362. {yyval.dval = yypvt[-0].dval;} break;
  1363. case 44:
  1364. # line 205 "strokegen.y"
  1365. {yyval.dval = yypvt[-0].dval;} break;
  1366.     }
  1367.     goto yystack;        /* reset registers in driver code */
  1368. }
  1369.